.class public Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;
.super Landroid/widget/FrameLayout;
.source "VideoViewPane.java"


# annotations
.annotation build Landroid/annotation/SuppressLint;
    value = {
        "NewApi"
    }
.end annotation


# instance fields
.field final mAudioControl:Lcom/burstly/lib/component/networkcomponent/burstly/AudioControlReciever;

.field mController:Lcom/burstly/lib/component/networkcomponent/burstly/NoSeekMediaController;

.field private mProgressDialog:Landroid/widget/FrameLayout;

.field mVideoRestarted:Z

.field private mVideoUrl:Ljava/lang/String;

.field private volatile mVideoView:Landroid/widget/VideoView;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 5
    .parameter "context"

    .prologue
    const/16 v4, 0x11

    const/high16 v3, -0x100

    .line 54
    invoke-direct {p0, p1}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V

    .line 55
    invoke-virtual {p0, v3}, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->setBackgroundColor(I)V

    .line 56
    sget v1, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v2, 0x8

    if-lt v1, v2, :cond_0

    new-instance v1, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane$1;

    invoke-direct {v1, p0, p1}, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane$1;-><init>(Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;Landroid/content/Context;)V

    :goto_0
    iput-object v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mVideoView:Landroid/widget/VideoView;

    .line 64
    iget-object v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mVideoView:Landroid/widget/VideoView;

    const/4 v2, 0x1

    invoke-virtual {v1, v2}, Landroid/widget/VideoView;->setZOrderMediaOverlay(Z)V

    .line 65
    iget-object v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mVideoView:Landroid/widget/VideoView;

    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->getMediaController()Landroid/widget/MediaController;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/widget/VideoView;->setMediaController(Landroid/widget/MediaController;)V

    .line 66
    invoke-static {}, Lcom/burstly/lib/util/Utils;->getFillparentValue()I

    move-result v0

    .line 67
    .local v0, fillparentVal:I
    iget-object v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mVideoView:Landroid/widget/VideoView;

    new-instance v2, Landroid/widget/FrameLayout$LayoutParams;

    invoke-direct {v2, v0, v0, v4}, Landroid/widget/FrameLayout$LayoutParams;-><init>(III)V

    invoke-virtual {p0, v1, v2}, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 68
    new-instance v1, Lcom/burstly/lib/component/networkcomponent/burstly/html/LoadingBarView;

    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-direct {v1, v2}, Lcom/burstly/lib/component/networkcomponent/burstly/html/LoadingBarView;-><init>(Landroid/content/Context;)V

    iput-object v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mProgressDialog:Landroid/widget/FrameLayout;

    .line 69
    iget-object v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mProgressDialog:Landroid/widget/FrameLayout;

    invoke-virtual {v1, v3}, Landroid/widget/FrameLayout;->setBackgroundColor(I)V

    .line 70
    iget-object v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mProgressDialog:Landroid/widget/FrameLayout;

    new-instance v2, Landroid/widget/FrameLayout$LayoutParams;

    invoke-direct {v2, v0, v0, v4}, Landroid/widget/FrameLayout$LayoutParams;-><init>(III)V

    invoke-virtual {p0, v1, v2}, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 71
    new-instance v1, Lcom/burstly/lib/component/networkcomponent/burstly/AudioControlReciever;

    invoke-direct {v1, p1}, Lcom/burstly/lib/component/networkcomponent/burstly/AudioControlReciever;-><init>(Landroid/content/Context;)V

    iput-object v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mAudioControl:Lcom/burstly/lib/component/networkcomponent/burstly/AudioControlReciever;

    .line 72
    return-void

    .line 56
    .end local v0           #fillparentVal:I
    :cond_0
    new-instance v1, Landroid/widget/VideoView;

    invoke-direct {v1, p1}, Landroid/widget/VideoView;-><init>(Landroid/content/Context;)V

    goto :goto_0
.end method


# virtual methods
.method public destroy()V
    .locals 1

    .prologue
    .line 111
    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->hideProgress()V

    .line 112
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mAudioControl:Lcom/burstly/lib/component/networkcomponent/burstly/AudioControlReciever;

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/AudioControlReciever;->unRegisterReciever()V

    .line 113
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mVideoView:Landroid/widget/VideoView;

    invoke-virtual {v0}, Landroid/widget/VideoView;->stopPlayback()V

    .line 114
    return-void
.end method

.method public getAudioControl()Lcom/burstly/lib/component/networkcomponent/burstly/AudioControlReciever;
    .locals 1

    .prologue
    .line 174
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mAudioControl:Lcom/burstly/lib/component/networkcomponent/burstly/AudioControlReciever;

    return-object v0
.end method

.method public getController()Landroid/widget/MediaController;
    .locals 1

    .prologue
    .line 162
    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->getMediaController()Landroid/widget/MediaController;

    move-result-object v0

    return-object v0
.end method

.method protected getMediaController()Landroid/widget/MediaController;
    .locals 2

    .prologue
    .line 85
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mController:Lcom/burstly/lib/component/networkcomponent/burstly/NoSeekMediaController;

    if-nez v0, :cond_0

    .line 86
    new-instance v0, Lcom/burstly/lib/component/networkcomponent/burstly/NoSeekMediaController;

    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1}, Lcom/burstly/lib/component/networkcomponent/burstly/NoSeekMediaController;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mController:Lcom/burstly/lib/component/networkcomponent/burstly/NoSeekMediaController;

    .line 88
    :cond_0
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mController:Lcom/burstly/lib/component/networkcomponent/burstly/NoSeekMediaController;

    return-object v0
.end method

.method public getProgressDialog()Landroid/widget/FrameLayout;
    .locals 1

    .prologue
    .line 154
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mProgressDialog:Landroid/widget/FrameLayout;

    return-object v0
.end method

.method getVideoUrl()Ljava/lang/String;
    .locals 1

    .prologue
    .line 170
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mVideoUrl:Ljava/lang/String;

    return-object v0
.end method

.method public getVideoView()Landroid/widget/VideoView;
    .locals 1

    .prologue
    .line 146
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mVideoView:Landroid/widget/VideoView;

    return-object v0
.end method

.method public hideProgress()V
    .locals 1

    .prologue
    .line 150
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mProgressDialog:Landroid/widget/FrameLayout;

    invoke-virtual {p0, v0}, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->removeView(Landroid/view/View;)V

    .line 151
    return-void
.end method

.method public onTouchEvent(Landroid/view/MotionEvent;)Z
    .locals 1
    .parameter "event"

    .prologue
    .line 76
    const/4 v0, 0x1

    return v0
.end method

.method public playVideo(Ljava/lang/String;)V
    .locals 1
    .parameter "url"

    .prologue
    .line 92
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mAudioControl:Lcom/burstly/lib/component/networkcomponent/burstly/AudioControlReciever;

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/burstly/AudioControlReciever;->registerReciever()V

    .line 93
    iput-object p1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mVideoUrl:Ljava/lang/String;

    .line 94
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mVideoRestarted:Z

    .line 95
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mVideoView:Landroid/widget/VideoView;

    invoke-virtual {v0, p1}, Landroid/widget/VideoView;->setVideoPath(Ljava/lang/String;)V

    .line 96
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mVideoView:Landroid/widget/VideoView;

    invoke-virtual {v0}, Landroid/widget/VideoView;->start()V

    .line 97
    return-void
.end method

.method public restartVideo()V
    .locals 2

    .prologue
    .line 100
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mVideoRestarted:Z

    .line 101
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mVideoView:Landroid/widget/VideoView;

    invoke-virtual {v0}, Landroid/widget/VideoView;->stopPlayback()V

    .line 102
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mVideoView:Landroid/widget/VideoView;

    iget-object v1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mVideoUrl:Ljava/lang/String;

    invoke-virtual {v0, v1}, Landroid/widget/VideoView;->setVideoPath(Ljava/lang/String;)V

    .line 103
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mVideoView:Landroid/widget/VideoView;

    invoke-virtual {v0}, Landroid/widget/VideoView;->pause()V

    .line 104
    return-void
.end method

.method public setListeners(Landroid/media/MediaPlayer$OnPreparedListener;Landroid/media/MediaPlayer$OnCompletionListener;Landroid/media/MediaPlayer$OnErrorListener;)V
    .locals 2
    .parameter "onPrep"
    .parameter "onCompl"
    .parameter "onError"

    .prologue
    .line 123
    if-eqz p1, :cond_0

    .line 124
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mVideoView:Landroid/widget/VideoView;

    new-instance v1, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane$2;

    invoke-direct {v1, p0, p1}, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane$2;-><init>(Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;Landroid/media/MediaPlayer$OnPreparedListener;)V

    invoke-virtual {v0, v1}, Landroid/widget/VideoView;->setOnPreparedListener(Landroid/media/MediaPlayer$OnPreparedListener;)V

    .line 137
    :cond_0
    if-eqz p3, :cond_1

    .line 138
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mVideoView:Landroid/widget/VideoView;

    invoke-virtual {v0, p3}, Landroid/widget/VideoView;->setOnErrorListener(Landroid/media/MediaPlayer$OnErrorListener;)V

    .line 140
    :cond_1
    if-eqz p2, :cond_2

    .line 141
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mVideoView:Landroid/widget/VideoView;

    invoke-virtual {v0, p2}, Landroid/widget/VideoView;->setOnCompletionListener(Landroid/media/MediaPlayer$OnCompletionListener;)V

    .line 143
    :cond_2
    return-void
.end method

.method public setProgressDialog(Landroid/widget/FrameLayout;)V
    .locals 0
    .parameter "progressDialog"

    .prologue
    .line 158
    iput-object p1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mProgressDialog:Landroid/widget/FrameLayout;

    .line 159
    return-void
.end method

.method public setVideoView(Landroid/widget/VideoView;)V
    .locals 0
    .parameter "videoView"

    .prologue
    .line 166
    iput-object p1, p0, Lcom/burstly/lib/component/networkcomponent/burstly/html/VideoViewPane;->mVideoView:Landroid/widget/VideoView;

    .line 167
    return-void
.end method
